#include <vector>
#include <iostream>
using namespace std;
vector<vector<int>> find(int m,int n){
    if (m<n) return vector<vector<int>>();
    vector<int> vector1;
    vector<vector<int>> vector2;
    vector<vector<int>> vector3;
    if (n==1) {
        for (int i=m; i>0; i--) {
            vector1.push_back(i);
            vector2.push_back(vector1);
            vector1.clear();
        }
        return vector2;
    }
    for (int i=m; i>=n; i--){
        vector2=find(i-1,n-1);
        for (int j=0; j<vector2.size(); j++){
            vector1=vector2[j];
            vector1.insert(vector1.begin(),i);
            vector3.push_back(vector1);
        }
    }
    return vector3;
}
int main(){
    int m=5, n=3;
    vector<vector<int>> result=find(m,n);
    for (int i=0; i<result.size(); i++){
        for (int j=0; j<result[i].size(); j++){
            cout<<result[i][j]<<" ";
        }
        if (i!=result.size()-1)cout<<",";
    }
    return 0;
}



